home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / cprog / illum.lha / geo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-08  |  1.1 KB  |  37 lines

  1. /* ****************************************************************
  2.  *                            geo.h
  3.  * ****************************************************************
  4.  * include file for the geometric utilities
  5.  */
  6. #ifndef GEO_H
  7. #define GEO_H
  8.  
  9. #ifndef TRUE
  10. #define TRUE    1
  11. #endif TRUE
  12. #ifndef FALSE
  13. #define FALSE   0
  14. #endif FALSE
  15.  
  16. /* common geometric constructs
  17.  */
  18. typedef struct {double  i, j, k;}        DIR_VECT;
  19. typedef struct {double  x, y, z;}        POINT3;
  20. typedef struct {double  x, y, z, h;}     POINT4;
  21. typedef struct {POINT3      start;
  22.         DIR_VECT    dir; }       LINE;
  23.  
  24. /* geometric manipulation routines
  25.  */
  26. double          geo_dot();      /* vector dot product */
  27. DIR_VECT        geo_cross();    /* vector cross product */
  28. double          geo_norm();     /* vector normalize */
  29. double          geo_line();     /* vector between two points */
  30. DIR_VECT        *geo_rfl();     /* reflected vector */
  31. DIR_VECT        *geo_rfr();     /* refracted vector */
  32. DIR_VECT        *geo_H();       /* H vector */
  33. DIR_VECT        *geo_Ht();      /* H' vector */
  34.  
  35. #endif GEO_H
  36. /* ************************************************************* */
  37.